package com.ccq.service;

import com.alibaba.fastjson.JSON;
import com.ccq.mapper.KnowledageMapper;
import com.ccq.model.Knowledage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KnowledgeService {
    @Autowired
    KnowledageMapper knowledageMapper;

    public String knowlist(String type){
        Knowledage k=new Knowledage();
        k.setType(type);
        List<Knowledage> ls=knowledageMapper.selectAimdata(k);
        String aListJson = JSON.toJSONString(ls);
        System.out.println(aListJson);
        return aListJson;
    }

    public String knowlist1(){
        List<Knowledage> ls=knowledageMapper.selectAlldata();
        String aListJson = JSON.toJSONString(ls);
        return aListJson;
    }
}
